<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2012. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <title>
      Refactoring Wizard
    </title>
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
  </head>
  <body>
    <h1>
      Refactoring Wizard
    </h1>
    <p>
      A dialog based user interface guides you through the steps necessary to execute a selected refactoring.
      Depending on the complexity of the refactoring, either a wizard or a simple dialog is used to gather information that is required for the refactoring.
    </p>

    <h2>
      Input pages
    </h2>
    <p>
      The input pages gather information that is required for the refactoring. 
      After you have provided the required input you can click <strong>Ok</strong> or <strong>Finish</strong> to carry out the refactoring without previewing
      the results. If you want to preview the changes press <strong>Preview</strong> or <strong>Next</strong></p>
    <h2>
      Preview page
    </h2>
    <p>
      The JDT allows you to preview the results of a refactoring action before you execute it.
    </p>
    <p>
      The preview page consists of two parts:
    </p>
    <ul>
      <li>
        <p>A tree at the top containing all Java elements affected by the refactoring. Each top-level 
        node in the tree represents one compilation unit.</p>
        <p>Some refactorings allow to filter the tree by different kind of changes made by the refactoring.
        Use the <b>Filter Changes</b> drop down to change the filtering.</p>
      </li>
      <li>
        A compare viewer at the bottom. The left side of the compare viewer shows the original, the right side displays the refactored source.
      </li>
    </ul>
    <h2>
      Problem page
    </h2>
    <p>
      The Refactoring Problem page indicates if there are suspected, potential, or definite problems with the refactoring action you are attempting.
    </p>
    <p>
      Four types of problems are possible:
    </p>
    <dl>
      <dt>
        Information
      </dt>
      <dd>
        A problem described as Information will not affect the refactoring in any way, nor will it negatively affect the code in the workbench. You can most likely ignore this type of
        problem.
      </dd>
      <dt>
        Warnings
      </dt>
      <dd>
        Warnings attempt to predict compile warnings. This type of problem most likely will not negatively affect the code in your workbench.
      </dd>
      <dt>
        Errors
      </dt>
      <dd>
        A problem described as an Error is very likely to cause compile errors or change your workbench code semantically. You can choose to continue with the refactoring in spite of these
        errors, although it is not recommended.
      </dd>
      <dt>
        Stop problems
      </dt>
      <dd>
        This type of problem prevents the refactoring from taking place. For example, if you select a comment and choose the Extract Method command from it, the
        workbench will issue a stop problem on the refactoring attempt because you cannot extract a comment.
	  </dd>
    </dl>
    <p>
      If there aren't any stop problems then the refactoring can be carried out by pressing the <strong>
      Finish</strong> button. To preview the results of the refactoring action, press the
      <strong>Next &gt;</strong> button.
    </p>

    <h2>
    	Refactoring without Dialog
    </h2>
    <p>
    	It is also possible to rename a Java element without showing a dialog. This can be enabled and disabled on the
    	<a href="preferences/ref-preferences-java.htm">Java</a> preference page. If enabled, then the new name for an Java element 
    	can be typed into the editor when the rename refactoring is invoked.
    </p>
    <h3 class="related">Related concepts</h3>
      <a href="../concepts/concept-refactoring.htm">Refactoring support</a>

    <h3 class="related">Related references</h3>
      <a href="ref-menu-refactor.htm">Refactoring actions</a><br>
      <a href="ref-icons.htm">Icons</a>
  </body>
</html>

